import request from '@/utils/request'

//
export function listTaskTypes(){
  return request({
    url: '/system/task/types',
    method: 'get'
  })
}
//
export function taskTypesMap(){
  return request({
    url: '/system/task/typesMap',
    method: 'get'
  })
}
//
export function listWorkStatus(){
  return request({
    url: '/system/work/status',
    method: 'get'
  })
}
export function workStatusMap(){
  return request({
    url: '/system/work/statusMap',
    method: 'get'
  })
}

//查询项目工作列表
export function listMyWork(query) {
  return request({
    url: '/system/work/list/my',
    method: 'get',
    params: query
  })
}

export function getWorkInfo(workId) {
  return request({
    url: '/system/work/' + workId,
    method: 'get'
  })
}

export function listByTask(taskId) {
  return request({
    url: '/system/work/list?taskId=' + taskId,
    method: 'get'
  })
}

export function listByChecker(query) {
  return request({
    url: '/system/work/list/checker',
    method: 'get',
    params: query
  })
}

export function listByEvaluator(query) {
  return request({
    url: '/system/work/list/evaluator',
    method: 'get',
    params: query
  })
}

export function listCheckerTask(query) {
  return request({
    url: '/system/task/list/checker',
    method: 'get',
    params: query
  })
}
// 删除项目
export function delWork(workId) {
  return request({
    url: '/system/work/remove?workId=' + workId,
    method: 'delete'
  })
}

export function executeWork(data) {
  return request({
    url: '/system/work/execute',
    method: 'post',
    data: data
  })
}

export function checkPass(data) {
  return request({
    url: '/system/work/pass',
    method: 'post',
    data: data
  })
}

export function checkReject(data) {
  return request({
    url: '/system/work/reject',
    method: 'post',
    data: data
  })
}

export function evaluateWork(data) {
  return request({
    url: '/system/work/evaluate',
    method: 'post',
    data: data
  })
}
export function attachment(data){
  return request({
    url: '/system/work/attachment',
    method: 'post',
    data: data
  })
}

export function deattachment(filePath) {
  return request({
    url: '/system/work/deattachment?filePath=' + encodeURI(filePath),
    method: 'delete'
  })
}